package com.xiaomage.ipcdemo

import android.content.Context
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper

class ContactOpenHelper :SQLiteOpenHelper {
    companion object {
        private const val DB_NAME="contacts.db"
        const val CONTACT_TABLE_NAME="contacts"
        private const val DB_VERSION=1
        private const val CREATE_CONTACT_TABLE="CREATE TABLE IF NOT EXISTS $CONTACT_TABLE_NAME" +
                " (phonenumber CHAR(11) PRIMARY KEY,name TEXT)"
    }
    constructor(context: Context):super(context,DB_NAME,null,DB_VERSION)

    override fun onCreate(db: SQLiteDatabase) {
        db.execSQL(CREATE_CONTACT_TABLE)
    }

    override fun onUpgrade(db: SQLiteDatabase?, oldVersion: Int, newVersion: Int) {
    }

}
